package com.example.lanqiaodemo.common;

import java.io.Serializable;

// 相应结果
public class Result implements Serializable {
    // 消息
    private String message;

    // 数据
    private Object data;

    // 代码 200 500
    private Integer code;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private Result(String message, Object data, Integer code) {
        this.message = message;
        this.data = data;
        this.code = code;
    }
    public static Result  ok(String message,Object data){
        return  new Result(message,data,200);
    }
    public static Result  notok(String message){
        return new Result(message,null,500);
    }
}
